import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home'

Vue.use(Router)

export default new Router({
  mete: {
    title: '广告机后台管理'
  },
  routes: [{
    path: '/',
    name: 'home',
    redirect: '/index',
    component: Home,
    meta: {
      requireAuth: true
    },
    children: [{
      path: 'index',
      name: 'index',
      meta: {
        requireAuth: true
      },
      /***
                 * 首页
                 */
      component: () =>
                    import(/* webpackChunkName: "about" */ './views/home/index.vue')
    }, {
      path: 'report',
      name: 'report',
      meta: {
        requireAuth: true
      },
      /***
                 * 报告
                 */
      component: () =>
                    import(/* webpackChunkName: "about" */ './views/report/index.vue')
    }, {
      path: 'device',
      name: 'device',
      meta: {
        requireAuth: true
      },
      /***
                 * 设备
                 */
      component: () =>
                    import(/* webpackChunkName: "about" */ './views/device/index.vue')
    }, {
      path: 'advertising',
      name: 'advertising',
      meta: {
        requireAuth: true
      },
      /***
                 * 广告数据
                 */
      component: () =>
                    import(/* webpackChunkName: "about" */ './views/advertising/index.vue')
    }, {
      path: 'material',
      name: 'material',
      meta: {
        requireAuth: true
      },
      /***
                 * 广告素材
                 */
      component: () =>
                    import(/* webpackChunkName: "about" */ './views/material/index.vue')
    }, {
      path: 'addtemplate',
      name: 'addtemplate',
      meta: {
        requireAuth: true
      },
      /***
                 * 新增模板
                 */
      component: () =>
                    import(/* webpackChunkName: "about" */ './views/addtemplate/index.vue')
    }, {
      path: 'advertisers',
      name: 'advertisers',
      meta: {
        requireAuth: true
      },
      /***
                 * 广告主
                 */
      component: () =>
                    import(/* webpackChunkName: "about" */ './views/advertisers/index.vue')
    }, {
      path: 'checkAD',
      name: 'checkAD',
      meta: {
        requireAuth: true
      },
      /***
                 * 审核
                 */
      component: () =>
                    import(/* webpackChunkName: "about" */ './views/checkAD/index.vue')
    }]
  },
  {
    path: '/about',
    name: 'about',
    meta: {
      requireAuth: true
    },
    component: () =>
                import(/* webpackChunkName: "about" */ './views/About.vue')
  },
  {
    path: '/login',
    name: 'login',
    component: () =>
                import(/* webpackChunkName: "about" */ './views/login/index.vue')
  }
  ]
})
